async function ${nodeId}(node, index) {
<#include "common/InitLogging.ftl">
    let input = [];
    try {
        let result = await new Promise(function (resolve, reject) {
            input.push(${sourceValue});

            let res = ((typeof ${sourceValue} == 'string') ? parseInt(${sourceValue}) : ${sourceValue});
            if (isNaN(res) || !Tools.isNumber(res)) {
                reject(new Error('参与计算的原始数据不是数字类型'));
                return ;
            }
            <#if "+-*/"?contains("${operate}")>
                <#list args as arg>
                    input.push(${arg});
                    res = res ${operate} ((typeof ${arg} == 'string') ? parseInt(${arg}) : ${arg});
                    if (isNaN(res) || !Tools.isNumber(res)) {
                        reject(new Error('计算过程中的数据不是数字类型'));
                        return ;
                    }
                </#list>
                <#elseif "avg"?contains("${operate}")>
                    <#list args as arg>
                        input.push(${arg});
                        res = res + ((typeof ${arg} == 'string') ? parseInt(${arg}) : ${arg});
                        if (isNaN(res) || !Tools.isNumber(res)) {
                            reject(new Error('计算过程中的数据不是数字类型'));
                            return ;
                        }
                    </#list>
                    res = res/(${args?size} + 1);
                <#elseif "Math.max.apply"?contains("${operate}") || "Math.min.apply"?contains("${operate}") >
                    let datas = [];
                    let tempValue;
                    datas.push(res);
                    <#list args as arg>
                        input.push(${arg});
                        tempValue = ((typeof ${arg} == 'string') ? parseInt(${arg}) : ${arg});
                        if (isNaN(tempValue) || !Tools.isNumber(tempValue)) {
                            reject(new Error('计算过程中的数据不是数字类型'));
                            return ;
                        }
                        datas.push(tempValue);
                        res = ${operate}(null,datas);
                    </#list>
                <#else>
                reject(new Error('js编译异常：不合法的操作'));
                return ;
            </#if>
            resolve(res);
        });
        node['${nodeId}'<#if loop>+ '_' + index</#if>] = result;
        return node['${nodeId}'<#if loop>+ '_' + index</#if>];
    } catch (e) {
        <#include "common/Catch.ftl">
    } finally {
        logEndTime = DebugLogging.getTimestamp();
        debugLogging.assignParam(65699, 203, '数值计算', JSON.stringify(input), node['${nodeId}'<#if loop>+ '_' + index</#if>], logStartTime, logEndTime);
        node.debugLog.push(debugLogging);
    }
}